package com.kfy.observerdemo.Pub_Sub;

/**
 * @ProjectName: ObserverDemo
 * @Package: com.kfy.observerdemo.Pub_Sub
 * @Author: K.F.Y
 * @Date: 2021/5/8
 */
public class IntegerPub implements IPublisher<Integer>{

    private String name;
    private int content;

    public IntegerPub(String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setContent(Integer content) {
        this.content = content;
    }

    @Override
    public Integer getContent() {
        return content;
    }

    @Override
    public void publish(SubscribePublish subscribePublish) {
        subscribePublish.publishAndUpdate(this);
    }

}
